home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_13_10
/
vesely
/
common
< prev
next >
Wrap
Text File
|
1995-08-02
|
726b
|
37 lines
// .h
#ifdef _DEBUG
void SqlTrace( LPCSTR);
#define TRACESQL(sz) ::SqlTrace(sz)
#else
inline void __cdecl SqlTrace(LPCSTR) { }
#define TRACESQL 1 ? (void)0 : ::SqlTrace
#endif
// .cpp
#ifdef _DEBUG
// tracing strings longer than 512
void SqlTrace(LPCSTR pszSQL)
{
ASSERT( AfxIsValidString( pszSQL));
if (afxTraceFlags & 0x20) // if db tracing
{
char *pszFormat = "SQL : %s\n";
int n = strlen( pszSQL);
char *psz = (char *) pszSQL;
while ( n)
{
int n1 = n > 110 ? 100 : n;
n -= n1;
char ch = psz[n1];
psz[n1] = 0;
AfxTrace( pszFormat, psz);
psz += n1;
*psz = ch;
pszFormat = "... %s\n";
}
}
}
#endif